package com.qf.edu.commons.web.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfiguration {

    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("在线教育平台接口文档")
                        .description("接口的相关描述")
                        //设置作者信息
                        .contact(new Contact().name("Ken").email("123@qq.com").url("http://www.baidu.com"))
                        .version("v1")
                        //设置开源协议版本
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        //外部文档描述
                        .description("外部文档")
                        .url("https://springshop.wiki.github.org/docs"));
    }
}
